<template>
	<div>
		<el-dialog title="查看详情" width="800px" @open="open" class="icon-dialog" :visible.sync="show" :before-close="closeForm" append-to-body>

      <el-table :data="maiList" height="calc(100vh - 300px)">
        <!--        <el-table-column label="No." width="60" align="right" type="index"></el-table-column>-->
        <el-table-column label="创建时间" width="180" prop="createTime"></el-table-column>
        <el-table-column label="单据日期" width="180" prop="orderTime"></el-table-column>
        <el-table-column label="单据编号" width="180" prop="orderNo"></el-table-column>
        <el-table-column label="单据类型" width="120" prop="ordertType"  :formatter="formatBoolean" ></el-table-column>
        <el-table-column label="创建人" width="120" prop="createUserName"></el-table-column>
      </el-table>

    </el-dialog>
	</div>
</template>
<script>
import { detail  } from '@/api/app/moldmaterial'
export default {
	name:'moldmaterialdetail',
	props: {
		show: {
			type: Boolean,
			default: true
		},
		size: {
			type: String,
			default: 'mini'
		},
		info: {
			type: Object,
		},
	},
	data() {
		return {
      maiList:[]
		}
	},
	watch:{
		show(val){
			if(val){
			}
		}
	},
	methods: {
    formatBoolean(row, column, cellValue) {
      return cellValue === 1 ? '检查单' : cellValue === 2 ? '维修单' : cellValue === 3 ? '报废单' : cellValue === 4 ? '调拨单' : '-'
    },
    open(){

      detail(this.info).then(res => {
        if (res.status == 200) {
          this.maiList = res.data.dataList;
          console.log('maiList',this.maiList)

        } else {
          this.$message.error('获取详情失败2，请稍后再试');
        }
      }).catch(error => {

        this.$message.error('获取详情失败，请稍后再试');
      });
    },
    closeForm(){
      this.$emit('update:show', false)
    }
	}
}
</script>
<style  lang="scss">
@import '@/assets/scss/common.scss'
</style>
